<?php 
include '../../entries/noauth.php';
include 'lib.php';

/**
 * 取数据，并设置title和content值
 */
$id = get('id', 1);
$FUPING = [
    'host'=>'mysql:host=rm-uf6rf8qj8e6663w1e.mysql.rds.aliyuncs.com;dbname=t_fuping',
    'user'=>'zdboy',
    'pwd'=>'Ac591234'
];
$res = Mdb::query($FUPING, 'select * from article where id=?', [$id]);
$title = $res[0]['set_title'];
$content = $res[0]['set_content'];

/**
 * 设置css和body值
 */
$css = "
    * {margin:0; box-sizing:border-box;}
    html {height:100%;}
    body {height:100%; margin:0; padding:0; font-size:14px; line-height:21px; background:#fff;}
    #app {flex: 1; height:100%; margin:0; padding:0; display: flex; flex-direction: column}
    table {border-collapse:collapse; border-spacing:0; width:100%;}
    ul, li {margin: 0; padding: 0; list-style:none; -webkit-padding-start:0;}
    input,button,select,textarea{outline:0 none;}
    a {text-decoration:none;}
    p {margin-bottom: 0;}
    i { position:relative;}
    img {width: 100%; margin: 5px 0}
";
$body = "
    <div style='padding: 18px;'>
        ${content}
    </div>
";

/**
 * 输出html
 */
WebView::action($title, $body, $css);
